{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=3181
  Verdict: Accepted
}
var n,m,k:longint;
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n,m,k);
if m>=k then write((m div k+k-1)*n) else
write(m*n);
end.